"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cac_1 = __importDefault(require("cac"));
const list_1 = __importDefault(require("./list"));
const package_json_1 = require("../package.json");
const init_1 = __importDefault(require("./init"));
const cli = cac_1.default(package_json_1.name);
cli
    .command('<template> [project]', 'Create new project from a template')
    .option('-f, --force', 'Overwrite if the target exists')
    .option('-o, --offline', 'Try to use an offline template')
    // .option('-d, --debug', 'Output detailed exception when exception occurs')
    .allowUnknownOptions() // for prompts override.
    .example('  # with an official template')
    .example(`  $ ${package_json_1.name} <template> [project]`)
    .example('  # with a custom github repo')
    .example(`  $ ${package_json_1.name} <owner>/<repo> [project]`)
    .action(init_1.default);
/// 查看所有的项目模板
cli
    .command('list [owner]', 'Show all available templates')
    .alias('ls') // 命令别名
    .option('-j, --json', 'Output with json format')
    .option('-s, --short', 'Output with short format')
    .action(list_1.default);
cli.command('version').action(() => {
    console.log(`当前版本${package_json_1.version}`);
});
cli.help().version(package_json_1.version).parse();
